package mse.eai.jbpm.dailyDigestProcess;

import java.util.Map;

import mse.eai.jbpm.confirmFriendshipRequest.PrepareFrienshipConfirmationNotification;

import org.jboss.logging.Logger;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;

public class HandleSentDigest implements ActionHandler {

	private static final Logger log = Logger.getLogger(HandleSentDigest.class);

	@Override
	public void execute(ExecutionContext context) throws Exception {

		log.info("Executing ---------->");

		Map<Integer, String> mapOfEmails = (Map<Integer, String>) context
				.getVariable("MapOfEmails");
		
		//log.info("Got from context: " + "MapOfEmails  = " + mapOfEmails);

		mapOfEmails.remove((Integer) context.getVariable("uid"));

		context.setVariable("MapOfEmails", mapOfEmails);
		
		//log.info("Set in context: " + "MapOfEmails  = " + mapOfEmails);
		log.info("Remaining : " + mapOfEmails.size());
		
		log.info("<--------------- Done");

		context.leaveNode();

	}

}
